<?php
/**
 * SEO 隐藏 文章列表 详情
 *
 * @author Zeon <scplay@gmail.com>
 * @date 2018/8/28
 * @copyright PanxSoft Inc.
 *
 * @var \Illuminate\Pagination\LengthAwarePaginator $articles
 * @var \App\Http\Models\Article $article
 */
?>

@if(isset($articles) && $articles->count())

    <div class="seo-hidden article-list">
        {{-- 文章列表 --}}
        <ul class="article-list">
            @foreach($articles as $article)
                <li class="article-item">
                    <a class="article-link"
                       href="{{ request()->fullUrl().'&detail_id='.$article->id }}"
                    >
                        <img src="{{ $article->thumb }}" alt="" class="article-detail-thumb">
                        <span class="article-title">{{ $article->title }}</span><p>
                        <span class="article-description">{{ $article->description }}</span><p>
                        <span class="article-date">{{ $article->created_at }}</span><p>
                    </a>
                </li>
            @endforeach
        </ul>

        {{-- 输出分页器 --}}
        {{ $articles->appends('article_type_id', $article->article_type_id)->links() }}
    </div>
@elseif(isset($article))
    <div class="seo-hidden article">
        <h1 class="article-title">{{ $article->title }}</h1>
        <h3 class="article-date">{{ $article->created_at  }}</h3>
        <img src="{{ $article->thumb }}" alt="" class="article-detail-thumb">
        <article>
            <p class="article-content">{!! $article->content !!} </p>
        </article>

    </div>

@endif